$(document).ready(function () {
	$("#btnBuscar").click(function () {
		buscar();
	});
	$("#txtFechaActual").datepicker();
	var dates = $("#txtFechaIni, #txtFechaFin").datepicker({
		changeMonth: true,
		changeYear: true,
		numberOfMonths: 1,
		showOn: "button",
		buttonText: '',
		buttonImage: "images/calendario.gif",
		buttonImageOnly: true,
		onSelect: function( selectedDate ) {
			var option = this.id == "txtFechaIni" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
	});
	$("#txtFechaIni").datepicker("option", "maxDate", $("#txtFechaActual").datepicker("getDate"));
	$("#txtFechaFin").datepicker("option", "maxDate", $("#txtFechaActual").datepicker("getDate"));
});
function buscar() {
	var datos = $("form").serialize();
	$.ajax({
        type: "post",
        url: "consultacarga.do?method=buscar",
        data: "abc=123&"+datos,
        success: function(xml) {
			$("#tbdArchivo").html(xml);
    	}
    });
}